using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_DrawArea_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.DrawArea);
            args = new Type[]{typeof(UnityEngine.Vector2)};
            method = type.GetMethod("CheckPix", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CheckPix_0);

            field = type.GetField("hw", flag);
            app.RegisterCLRFieldGetter(field, get_hw_0);
            app.RegisterCLRFieldSetter(field, set_hw_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_hw_0, AssignFromStack_hw_0);
            field = type.GetField("Start", flag);
            app.RegisterCLRFieldGetter(field, get_Start_1);
            app.RegisterCLRFieldSetter(field, set_Start_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Start_1, AssignFromStack_Start_1);
            field = type.GetField("End", flag);
            app.RegisterCLRFieldGetter(field, get_End_2);
            app.RegisterCLRFieldSetter(field, set_End_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_End_2, AssignFromStack_End_2);
            field = type.GetField("box", flag);
            app.RegisterCLRFieldGetter(field, get_box_3);
            app.RegisterCLRFieldSetter(field, set_box_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_box_3, AssignFromStack_box_3);
            field = type.GetField("minx", flag);
            app.RegisterCLRFieldGetter(field, get_minx_4);
            app.RegisterCLRFieldSetter(field, set_minx_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_minx_4, AssignFromStack_minx_4);
            field = type.GetField("miny", flag);
            app.RegisterCLRFieldGetter(field, get_miny_5);
            app.RegisterCLRFieldSetter(field, set_miny_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_miny_5, AssignFromStack_miny_5);
            field = type.GetField("maxx", flag);
            app.RegisterCLRFieldGetter(field, get_maxx_6);
            app.RegisterCLRFieldSetter(field, set_maxx_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_maxx_6, AssignFromStack_maxx_6);
            field = type.GetField("maxy", flag);
            app.RegisterCLRFieldGetter(field, get_maxy_7);
            app.RegisterCLRFieldSetter(field, set_maxy_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_maxy_7, AssignFromStack_maxy_7);


            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.DrawArea[s]);

            args = new Type[]{typeof(UnityEngine.Vector2), typeof(UnityEngine.Vector2), typeof(System.Single)};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* CheckPix_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector2 @pos = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.DrawArea instance_of_this_method = (huqiang.UIComposite.DrawArea)typeof(huqiang.UIComposite.DrawArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.CheckPix(@pos);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }


        static object get_hw_0(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).hw;
        }

        static StackObject* CopyToStack_hw_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).hw;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_hw_0(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).hw = (System.Single)v;
        }

        static StackObject* AssignFromStack_hw_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @hw = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.DrawArea)o).hw = @hw;
            return ptr_of_this_method;
        }

        static object get_Start_1(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).Start;
        }

        static StackObject* CopyToStack_Start_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).Start;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Start_1(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).Start = (UnityEngine.Vector2)v;
        }

        static StackObject* AssignFromStack_Start_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @Start = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.UIComposite.DrawArea)o).Start = @Start;
            return ptr_of_this_method;
        }

        static object get_End_2(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).End;
        }

        static StackObject* CopyToStack_End_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).End;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_End_2(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).End = (UnityEngine.Vector2)v;
        }

        static StackObject* AssignFromStack_End_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @End = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.UIComposite.DrawArea)o).End = @End;
            return ptr_of_this_method;
        }

        static object get_box_3(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).box;
        }

        static StackObject* CopyToStack_box_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).box;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_box_3(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).box = (UnityEngine.Vector2[])v;
        }

        static StackObject* AssignFromStack_box_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2[] @box = (UnityEngine.Vector2[])typeof(UnityEngine.Vector2[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.DrawArea)o).box = @box;
            return ptr_of_this_method;
        }

        static object get_minx_4(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).minx;
        }

        static StackObject* CopyToStack_minx_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).minx;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_minx_4(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).minx = (System.Single)v;
        }

        static StackObject* AssignFromStack_minx_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @minx = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.DrawArea)o).minx = @minx;
            return ptr_of_this_method;
        }

        static object get_miny_5(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).miny;
        }

        static StackObject* CopyToStack_miny_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).miny;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_miny_5(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).miny = (System.Single)v;
        }

        static StackObject* AssignFromStack_miny_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @miny = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.DrawArea)o).miny = @miny;
            return ptr_of_this_method;
        }

        static object get_maxx_6(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).maxx;
        }

        static StackObject* CopyToStack_maxx_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).maxx;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_maxx_6(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).maxx = (System.Single)v;
        }

        static StackObject* AssignFromStack_maxx_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @maxx = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.DrawArea)o).maxx = @maxx;
            return ptr_of_this_method;
        }

        static object get_maxy_7(ref object o)
        {
            return ((huqiang.UIComposite.DrawArea)o).maxy;
        }

        static StackObject* CopyToStack_maxy_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DrawArea)o).maxy;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_maxy_7(ref object o, object v)
        {
            ((huqiang.UIComposite.DrawArea)o).maxy = (System.Single)v;
        }

        static StackObject* AssignFromStack_maxy_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @maxy = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.DrawArea)o).maxy = @maxy;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @w = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2 @e = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Vector2 @s = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = new huqiang.UIComposite.DrawArea(@s, @e, @w);

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
